home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / circuits / spice2g6.z / spice2g6 / spice / Fortran / sorstp.f < prev    next >
Encoding:
Text File  |  1989-02-03  |  2.2 KB  |  74 lines

  1.       subroutine sorstp(itlim)
  2.       implicit double precision (a-h,o-z)
  3. c
  4. c     this routine uses the source stepping method to solve the dc
  5. c     operating point
  6. c
  7. c spice version 2g.6  sccsid=knstnt 3/15/83
  8.       common /knstnt/ twopi,xlog2,xlog10,root2,rad,boltz,charge,ctok,
  9.      1   gmin,reltol,abstol,vntol,trtol,chgtol,eps0,epssil,epsox,
  10.      2   pivtol,pivrel
  11. c spice version 2g.6  sccsid=cirdat 3/15/83
  12.       common /cirdat/ locate(50),jelcnt(50),nunods,ncnods,numnod,nstop,
  13.      1   nut,nlt,nxtrm,ndist,ntlin,ibr,numvs,numalt,numcyc
  14. c spice version 2g.6  sccsid=status 3/15/83
  15.       common /status/ omega,time,delta,delold(7),ag(7),vt,xni,egfet,
  16.      1   xmu,sfactr,mode,modedc,icalc,initf,method,iord,maxord,noncon,
  17.      2   iterno,itemno,nosolv,modac,ipiv,ivmflg,ipostp,iscrch,iofile
  18. c spice version 2g.6  sccsid=miscel 3/15/83
  19.       common /miscel/ atime,aprog(3),adate,atitle(10),defl,defw,defad,
  20.      1  defas,rstats(50),iwidth,lwidth,nopage
  21. c spice version 2g.6  sccsid=flags 3/15/83
  22.       common /flags/ iprnta,iprntl,iprntm,iprntn,iprnto,limtim,limpts,
  23.      1   lvlcod,lvltim,itl1,itl2,itl3,itl4,itl5,itl6,igoof,nogo,keof
  24. c spice version 2g.6  sccsid=blank 3/15/83
  25.       common /blank/ value(200000)
  26.       integer nodplc(64)
  27.       complex cvalue(32)
  28.       equivalence (value(1),nodplc(1),cvalue(1))
  29. c
  30.       bound=1.0d0/64
  31.       fractn=1.0d0/16
  32. c
  33. c  step down sources
  34. c
  35.    10 fractn=fractn*2.0d0
  36.       sfactr=sfactr*fractn
  37.       if (sfactr.lt.bound) go to 100
  38.       initf=2
  39.       call iter8(itlim)
  40.       rstats(6)=rstats(6)+iterno
  41.       if (igoof.ne.0) go to 10
  42.       fractn=2.0d0
  43. c
  44. c  step up sources
  45. c
  46.    20 sfactr=sfactr*fractn
  47.       if (sfactr.le.1.0d0) go to 30
  48.       sfactr=1.0d0
  49.    30 initf=3
  50.       call iter8(itlim)
  51.       rstats(6)=rstats(6)+iterno
  52.       if ((igoof.eq.0).and.(sfactr.eq.1.0d0)) go to 200
  53.       if (igoof.eq.0) go to 20
  54. c
  55. c  step down if step up failed
  56. c
  57.    40 fractn=dsqrt(fractn)
  58.       if (fractn.lt.1.0001d0) go to 100
  59.       sfactr=sfactr/fractn
  60.       initf=3
  61.       call iter8(itlim)
  62.       rstats(6)=rstats(6)+iterno
  63.       if (igoof.ne.0) go to 40
  64.       go to 20
  65. c
  66. c   finish with source stepping method
  67. c
  68.   100 igoof=1
  69.       write(iofile,110)
  70.   110 format('0 source stepping method failed')
  71.   200 initf=2
  72.       return
  73.       end
  74.